package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.AbstractAccount;

public class SavingAccount extends AbstractAccount {
	private double maximumAmountToWithdraw;

	public SavingAccount(double initial) {
		super(initial);
	}

	@Override
	public void deposit(double amount) {
		balance += amount;
	}

	@Override
	public void withdraw(double amount) {
		if (balance >= amount) {
			balance -= amount;
		}

	}

	@Override
	public void getBalance() {
		System.out.println("balance: " + balance);
	}

	@Override
	public double maximumAmountToWithdraw() {
		maximumAmountToWithdraw = balance;
		return maximumAmountToWithdraw;
	}

}
